﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Durak_Game
{
    public partial class Statistics : Form
    {
        public Statistics()
        {
            InitializeComponent();
        }

        private void Statistics_Load(object sender, EventArgs e)
        {
            String[] lines = System.IO.File.ReadAllLines("stat.txt");
            int computerWon = 0;
            int userWon = 0;
           
            foreach (string line in lines)
            {
                if (line.Contains("computer"))
                {
                    computerWon++;
                }
                else if (line.Contains("user"))
                {
                    userWon++;
                }
            }
            label2.Text = "Computer Won : " + computerWon + " games";
            label3.Text = "You Won         : " + userWon + " games";


        }
    }
}
